﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Log
{
    /// <summary>
    /// 日志接口
    /// </summary>
    /// <remarks>提供了标准的日志输出接口定义</remarks>
    /// <history>
    /// [zanezeng]               2009/9/22 17:31    创建
    /// </history>
    public interface ILog : ILoggerProvider
    {
        #region ---Property

        /// <summary>
        /// 根据当前日志级别设定判断是否允许输出调试级别日志信息
        /// </summary>
        /// <value>
        /// 	<c>true</c>：允许输出<br/>
        /// 	<c>false</c>：不允许输出
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/23 9:20    创建
        /// </history>
        bool IsDebugEnabled
        {
            get;
        }

        /// <summary>
        /// 根据当前日志级别设定判断是否允许输出跟踪级别日志信息
        /// </summary>
        /// <value>
        /// 	<c>true</c>：允许输出<br/>
        /// 	<c>false</c>：不允许输出
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/23 9:20    创建
        /// </history>
        bool IsTraceEnabled
        {
            get;
        }

        /// <summary>
        /// 根据当前日志级别设定判断是否允许输出提示级别日志信息
        /// </summary>
        /// <value>
        /// 	<c>true</c>：允许输出<br/>
        /// 	<c>false</c>：不允许输出
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/23 9:20    创建
        /// </history>
        bool IsInfoEnabled
        {
            get;
        }

        /// <summary>
        /// 根据当前日志级别设定判断是否允许输出警告级别日志信息
        /// </summary>
        /// <value>
        /// 	<c>true</c>：允许输出<br/>
        /// 	<c>false</c>：不允许输出
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/23 9:20    创建
        /// </history>
        bool IsWarnEnabled
        {
            get;
        }

        /// <summary>
        /// 根据当前日志级别设定判断是否允许输出错误级别日志信息
        /// </summary>
        /// <value>
        /// 	<c>true</c>：允许输出<br/>
        /// 	<c>false</c>：不允许输出
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/23 9:20    创建
        /// </history>
        bool IsErrorEnabled
        {
            get;
        }

        /// <summary>
        /// 根据当前日志级别设定判断是否允许输出灾难级别日志信息
        /// </summary>
        /// <value>
        /// 	<c>true</c>：允许输出<br/>
        /// 	<c>false</c>：不允许输出
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/23 9:20    创建
        /// </history>
        bool IsFatalEnabled
        {
            get;
        }

        #endregion

        #region ---Method

        /// <summary>
        /// 判断给定的日志级别的日志信息是否允许输出
        /// </summary>
        /// <param name="level">用于判定的日志级别</param>
        /// <returns>
        /// 	<c>true</c>：允许输出<br/>
        /// 	<c>false</c>：不允许输出
        /// </returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="level"/>为Null</exception>
        /// <history>
        /// [zanezeng]               2009/9/23 9:25    创建
        /// </history>
        bool IsLevelEnabled( Level level );

        /// <summary>
        /// 输出调试信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Debug( object message );

        /// <summary>
        /// 输出调试信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <param name="ex">需要输出到日志的异常对象</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Debug( object message, Exception ex );

        /// <summary>
        /// 输出跟踪信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Trace( object message );

        /// <summary>
        /// 输出跟踪信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <param name="ex">需要输出到日志的异常对象</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Trace( object message, Exception ex );

        /// <summary>
        /// 输出提示信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Info( object message );

        /// <summary>
        /// 输出提示信息
        /// </summary>
        /// <param name="ex">需要输出到日志的异常对象</param>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Info( object message, Exception ex );

        /// <summary>
        /// 输出警告信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Warn( object message );

        /// <summary>
        /// 输出警告信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <param name="ex">需要输出到日志的异常对象</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Warn( object message, Exception ex );

        /// <summary>
        /// 输出错误信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Error( object message );

        /// <summary>
        /// 输出错误信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <param name="ex">需要输出到日志的异常对象</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Error( object message, Exception ex );

        /// <summary>
        /// 输出致命错误信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Fatal( object message );

        /// <summary>
        /// 输出致命错误信息
        /// </summary>
        /// <param name="message">需要输出到日志的信息</param>
        /// <param name="ex">需要输出到日志的异常对象</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]   9/6/2008 9:30 AM    Created
        /// </history>
        void Fatal( object message, Exception ex );

        /// <summary>
        /// 输出日志信息
        /// </summary>
        /// <param name="level">日志的级别</param>
        /// <param name="message">需要输出到日志的信息</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/24 9:23    创建
        /// </history>
        void WriteLog( Level level, object message );

        /// <summary>
        /// 输出日志信息
        /// </summary>
        /// <param name="level">日志的级别</param>
        /// <param name="message">需要输出到日志的信息</param>
        /// <param name="ex">需要输出到日志的异常对象</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/9/24 9:23    创建
        /// </history>
        void WriteLog( Level level, object message, Exception ex );

        #endregion
    }
}
